Beginning Programming FOR Dummies 3RD EDITION by Wallace Wang

Beginning Programming FOR Dummies 3RD EDITION by Wallace Wang

Author:Wallace Wang [Wang, Wallace]
Language: eng
Format: epub
Tags: Team DDU
Published: 0101-01-01T00:00:00+00:00


19 549979 Ch14.qxd 11/4/03 12:19 PM Page 198

198 Part III: Advanced Programming with Liberty BASIC

Each time that you create additional menu commands, you need to create instructions (which a [label] identifies) for the computer to follow whenever the user chooses those commands.

Figure 14-2:

Liberty

BASIC

can create

pull-down

menus.

Making Pop-Up Menus

In addition to pull-down menus, many programs also offer pop-up menus that appear next to the mouse pointer when you right-click the mouse. To create a pop-up menu in Liberty BASIC, you need to use the POPUPMENU command, as follows:

POPUPMENU “command1”, [label1], “command2”, [label2]

To make the POPUPMENU easier to understand, place each command and label on a separate line and use the underscore character (_) at the end of each line.

The underscore character tells Liberty BASIC that additional instructions appear on the following line. You can use the underscore character to divide long lines of commands into shorter, separate lines, such as you see in the following example:

POPUPMENU _

“command1”, [label1], _

“command2”, [label2], _

“command3”, [label3]

19 549979 Ch14.qxd 11/4/03 12:19 PM Page 199

Chapter 14: Creating a User Interface

199

Here’s what the preceding commands do:

1. The POPUPMENU command tells the computer, “Create a pop-up menu next to the current position of the mouse pointer.”

2. The “command1” and “command2“ text are the actual commands that appear on the pop-up menu. You can add additional commands so that your pop-up menus can display 5, 7, or 15 different commands.

3. The [label1] and [label2] labels identify instructions for the computer to follow if the user chooses a particular menu command. So if the user chose “command1”, the computer immediately follows the instructions that the [label1] label identifies.

If you want to add a horizontal line to separate commands on your pop-up menu, just use the vertical line character (|) in place of a command and omit any label following the | character, as shown in the example below.

POPUPMENU _

“command1”, [label1], _

|, _

“command3”, [label3]

To see how pop-up menus work, try the following program, as shown in Figure 14-3. Notice how the vertical line character creates a horizontal line to separate commands on the pop-up menu.

NOMAINWIN

POPUPMENU _

“Destroy the planet”, [one], _

“Poison the environment”, [two], _

| ,_

“Get elected to political office”, [three]

NOTICE “Nothing selected.”

END

[one]

NOTICE “Launching missiles now.”

END

[two]

NOTICE “Spilling oil into the oceans.”

END

[three]

NOTICE “Fooled the public once more.”

END



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Eco-friendly approach of bio-indigo synthesis and developing purification methods towards isolation of indigo from indirubin and bacterial fragments by Ramalingam Manivannan & Kaliyan Prabakaran & Young-A Son(206630)
Personalized inhaled bacteriophage therapy for treatment of multidrug-resistant Pseudomonas aeruginosa in cystic fibrosis by unknow(175055)
CONSORT 2025 statement: updated guideline for reporting randomized trials by unknow(83434)
Critical evaluation of the ProfiLER-02 study design and outcomes by Vivek Subbiah & Razelle Kurzrock(83132)
Cardiac gene therapy makes a comeback by Oliver J. Müller & Susanne Hille & Anca Kliesow Remes(82965)
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(74436)
Unveiling the design rules for tunable emission in graphene quantum dots: A high-throughput TDDFT and machine learning perspective by Şener Özönder & Mustafa Coşkun Özdemir & Caner Ünlü(50892)
A yeast-based oral therapeutic delivers immune checkpoint inhibitors to reduce intestinal tumor burden by unknow(40259)
Covalent hitchhikers guide proteins to the nucleus by Alexander F. Russell & Madeline F. Currie & Champak Chatterjee(40215)
Meet the Authors: Christopher R. Mansfield and Emily R. Derbyshire by Christopher R. Mansfield & Emily R. Derbyshire(40094)
Alkaline-earth metals promote propane dehydrogenation with carbon dioxide through geometric effects: Altering the reaction pathway by unknow(32730)
Induced iron vacancies boosting FeOOH loaded on sustainable Fenton-like collagen fiber membrane for efficient removal of emerging contaminants by unknow(32504)
Efficient electric-field-assisted photochemical conversion of methane to n-propanol exclusively over penetrated TiO2Ti hollow fibers by Guanghui Feng(32452)
Bi2SiO5 nanosheets as piezo-photocatalyst for efficient degradation of 2,4-Dichlorophenol by Hangyu Shi & Yifu Li & Lishan Zhang & Guoguan Liu & Qian Zhang & Xuan Ru & Shan Zhong(32384)
A novel NDIPTA organic heterojunction photocatalyst with built-in electric field for efficient hydrogen production by Jiahui Yang & Baojun Ma & Yongfa Zhu(32360)
Enhanced conversion of methane to liquid-phase oxygenates via hollow ferrite nanotube@horseradish peroxidase based photoenzymatic catalysis by Jun Duan & Shiying Fan & Xinyong Li & Shaomin Liu(32330)
Ordered macroporous superstructure of defective carbon adorned with tiny cobalt sulfide for selective electrocatalytic hydrogenation of cinnamaldehyde by Xiao-Shi Yuan & Sheng-Hua Zhou & San-Mei Wang & Wenbo Wei & Xiaofang Li & Xin-Tao Wu & Qi-Long Zhu(32256)
What's Done in Darkness by Kayla Perrin(27145)
Topological analysis of non-conjugated ethylene oxide cored dendrimers decorated with tetraphenylethylene: Insights from degree-based descriptors using the polynomial approach by A Theertha Nair & D Antony Xavier & Annmaria Baby & S Akhila(26522)
Investigation of mechanical and self-healing properties of hydroxyl-terminated polybutadiene functionalized with 2-ureido-4-pyrimidinone by Mohsen Kazazi & Mehran Hayaty & Ali Mousaviazar(26457)